from flask import Flask
from config.app import app_config
from flask_cors import CORS
from application import create_app, api
from flask_restx import Resource
from utils import response

app = Flask(__name__)
app.config.update(app_config)

# 跨域
CORS(app, supports_credentials=True)

# 初始化设置
create_app(app)


@api.route('/health')
class Health(Resource):
  @api.doc('健康检查接口')
  def get(self):
    """健康检查接口"""
    return response(code=200, message='OK')


if __name__ == '__main__':
  app.run(host='0.0.0.0', port=8000, debug=True)
